package com.geektime.hello.config;

import com.rabbitmq.client.AMQP;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: DRevelation
 * @Date: 2021/4/28 16:33
 */
@Configuration
public class RabbitMQConf {

    @Bean
    public Queue demoQueue01() {
        return new Queue("spring-queue", true, false, false);
    }

    @Bean
    public DirectExchange demoExchange01() {
        return new DirectExchange("spring-exchange", true, false);
    }

    @Bean
    public Binding demoBinding01() {
        return BindingBuilder.bind(demoQueue01()).to(demoExchange01()).with("spring-routing-key");
    }
}
